package com.yuyou.tas.lesson.service;

import com.yuyou.tas.service.api.lesson.dto.LessonChapterDetDTO;
import com.yuyou.tas.service.api.lesson.dto.LessonChapterPageDTO;
import com.yuyou.tas.service.api.lesson.entity.Lesson;
import com.yuyou.tas.service.api.lesson.entity.LessonChapter;
import com.yuyou.tas.service.api.lesson.entity.LessonClassChapter;
import com.yuyou.tas.util.bean.LoginRedisObj;
import com.yuyou.tas.util.bean.Pagination;
import com.yuyou.tas.util.bean.ResBoolSimpleInfo;

import java.util.List;

public interface ILessonChapterService {
    int deleteByPrimaryKey(Long id);

    int insert(LessonChapter record);

    LessonChapter selectByPrimaryKey(Long id);

    LessonChapter selectByPKandOrgan(Long id,Long authOrganizationId);
    
    int updateByPrimaryKeySelective(LessonChapter record);
    
    int findLessonChapterCount(Pagination<LessonChapterPageDTO> queryPgn);
    
    List<LessonChapterPageDTO> findLessonChapterPageList(Pagination<LessonChapterPageDTO> queryPgn);
    
    List<LessonChapter> findLessonChapterByLessId(Long lessonId);
    
    ResBoolSimpleInfo<String> addLessonChapters(List<Long> baseChapterIds,Long lessonId ,Boolean isSystem,Long userId,Long sortId)throws Exception;
    
    ResBoolSimpleInfo<String> delLessonChapters(Long lessonId,Long id,Long userId)throws Exception;
    
    ResBoolSimpleInfo<LessonChapterDetDTO> detailLesChapters(Long lessonId,Long id,Long userId)throws Exception;
    
    ResBoolSimpleInfo<String> hideLesChapters(Long lessonId,Long id,Integer isHide,Long userId)throws Exception;
    
    ResBoolSimpleInfo<String> publishLesChapters(Long lessonId,List<Long> ids,Long userId)throws Exception;
    
    ResBoolSimpleInfo<String> changeLessonChapters(Long lessonId,Long id,Long baseChapterId,Long userId)throws Exception;
    
    ResBoolSimpleInfo<String> sortAllLesCha(Long lessonId,List<Long> ids,Long userId)throws Exception;
    
    ResBoolSimpleInfo<String> copyChapterByChapter(Long lessonId, Lesson currLesson,LoginRedisObj obj)throws Exception;

    ResBoolSimpleInfo<LessonClassChapter> detailLessonClassChapter(Long lessonClassId, Long lessonId, Long lessonChapterId);

    List<String> findBaseChaInLesson(Long baseChapterId);

    Integer findCountByBaseCha(Long baseChapterId);

    void delByless(Long lessonId);

    /**
     * 发布讲次，同步班级讲次
     * @param lessonChapId
     * @return
     * @throws Exception
     */
	ResBoolSimpleInfo<String> upGradeClassByLessonCha(Long lessonChapId)
			throws Exception;

    ResBoolSimpleInfo<String> delOldData();

    ResBoolSimpleInfo<String> delOldDataLeave();
}